<script type="text/javascript">
function onUploadSuccess(f,d,r){
	var d = eval("("+d+")");
	var html = '<div class="jslt fileBox">'
    			+'<a href="javascript:;" class="jsltsy" onclick="delUploadFile($(this),\''+d.fileName+'\');"><img src="<{STATIC_PATH}>/images/admin/sc.png" /></a>'
    			+'<span class="jslts"><img src="../app/data/upload/album/'+d.fileName+'" /></span>'
    			+'<span class="jsltx">'+f.name+'</span>'
    			+'<input type="hidden" name="img[]" value="'+d.fileName+'"/>'
    			+'</div>';
	$("#filesBox_<{$_rand}>").append(html);
}
function delUploadFile(obj,file){
	$.post(
		'admin.php?c=example&a=uploadImg&action=delFile',
		{file:file},
		function(data){
			obj.parent().remove();
		}
	)
}
</script>
<h2 class="contentTitle">添加</h2>

<div class="pageContent">	
	<form method="post" action="admin.php?c=example&a=example_add" class="pageForm required-validate" onsubmit="return iframeCallback(this,navTabAjaxDone);" enctype="multipart/form-data">
		<div class="pageFormContent nowrap" layoutH="97">
			<!-- <dl>
				<dt>原密码：</dt>
				<dd>
					<input type="password" class="required" name="oldpwd" datatype="*" ajaxurl="setpwd.php?action=checkold" nullmsg="请输入原密码" errormsg="密码格式错误"/>
				</dd>
			</dl> -->
			<dl>
				<dt>名称：</dt>
				<dd>
					<input type="text" class="required" name="title" value="<{$info['name']}>" datatype="*" />
				</dd>
			</dl>
			<dl>
				<dt>上下架：</dt>
				<dd>
					<label><input type="radio" name="shelf" value="up">上架<input type="radio" name="shelf" value="down">下架</label>
				</dd>
			</dl>
			<dl>
				<dt>真姓名：</dt>
				<dd>
					<input type="text" class="required" value="<{$info['realname']}>" name="realname" datatype="*" nullmsg="请输入姓名" />
				</dd>
			</dl>
			<dl>
				<dt>年龄：</dt>
				<dd>
					<input type="text" class="required" value="<{$info['realname']}>" name="age" datatype="*" nullmsg="请输入年龄" />
				</dd>
			</dl>

			<dl>
				<dt>图片：</dt>
				<dd>
					<input type="file" class="required" name="img" datatype="*" nullmsg="请上传图片" />
				</dd>
			</dl>
			<{if($info['img']){}>
			<dl>
				<dt>图片预览：</dt>
				<dd>
					<img width="100" src="<{APP_PATH}>data/upload/album/<{$info['img']}>">
				</dd>
			</dl>
			<{}}>
			<dl>
				<dt>相册：</dt>
				<dd>
					
					<input type="file" id="fileInp_<{$_rand}>" name="image" value="请选择文件"
						uploaderOption="{
							swf:'<{STATIC_PATH}>uploadify/scripts/uploadify.swf',
							uploader:'admin.php?c=example&a=uploadImg&action=upload',
							formData:{PHPSESSID:'xxx', ajax:1},
							buttonText:'请选择文件',
							fileSizeLimit:'2MB',
							fileTypeDesc:'*.jpg;*.jpeg;*.gif;*.png;',
							fileTypeExts:'*.jpg;*.jpeg;*.gif;*.png;',
							queueSizeLimit:5,
							queueID:'queueBox',
							auto:true,
							multi:true,
							onUploadSuccess : onUploadSuccess
						}"
					/>
					<div id="queueBox" style="display:none;"></div>

				</dd>
			</dl>
			<dl>
				<dt>&nbsp;</dt>
				<dd id="filesBox_<{$_rand}>"></dd>
			</dl>

			<dl>
				<dt>编辑器：</dt>
				<dd>
					<div class="unit">
						<textarea class="editor" name="intro" rows="18" cols="100"
									upLinkUrl="upload.php" upLinkExt="zip,rar,txt" 
									upImgUrl="upload.php" upImgExt="jpg,jpeg,gif,png" 
									upFlashUrl="upload.php" upFlashExt="swf"
									upMediaUrl="upload.php" upMediaExt:"avi">

						</textarea>
					</div>
				</dd>
			</dl>
			
		</div>
		<div class="formBar" style="float:;">
			<ul style="float:left;">
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">提交</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
	   </div>	
	</form>
</div>